package com.example.demo.models;

import com.example.demo.models.base.BaseEntity;

import gaarason.database.annotation.Column;
import gaarason.database.annotation.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.springframework.stereotype.Repository;

/**
 * @author lucifer
 * @since 2024-01-31-23:43
 */
@Data
@ToString(callSuper = true)
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@Table(name = "activities")
public class Activity extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * auto generator start
     **/
    @Column(name = "number", comment = "活动发布者学号")
    private String number;

    @Column(name = "title", comment = "活动标题")
    private String title;

    @Column(name = "zone", comment = "活动区域")
    private String zone;

    @Column(name = "type", comment = "活动类型")
    private String type;

    @Column(name = "content", comment = "活动内容")
    private String content;

    @Column(name = "first_image", comment = "活动封面图")
    private String firstImage;

    @Column(name = "activity_start", comment = "活动开始时间", nullable = true)
    private String activityStart;

    @Column(name = "activity_end", comment = "活动结束时间", nullable = true)
    private String activityEnd;

    @Column(name = "enroll_start", comment = "活动报名开始时间", nullable = true)
    private String enrollStart;

    @Column(name = "enroll_end", comment = "活动报名结束时间", nullable  = true)
    private String enrollEnd;

    @Column(name = "count", comment = "活动人数限制", nullable = true)
    private Integer count;

    @Column(name = "college", comment = "活动学院限制")
    private String college;

    @Column(name = "status", comment = "活动状态限制")
    private Integer status;

    @Column(name = "is_open", comment = "活动是否开放")
    private Integer isOpen;

    /**
     * auto generator end
     **/
    @Repository
    public static class Model extends BaseModel<Activity, Long> {
        @Override
        protected boolean softDeleting() {
            return true;
        }
    }
}
